<%-- 
    Document   : muasanpham
    Created on : Nov 3, 2011, 2:37:39 PM
    Author     : Rocker000
--%>

<%@page import="pojo.KhachHang_pojo"%>
<%@page import="dao.SanPham_dao"%>
<%@page import="pojo.SanPham_pojo"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%
KhachHang_pojo kh = new KhachHang_pojo();
String tenkhachhang = "";String email ="";String username="";String diachi="";String sodienthoai="";
if(session.getAttribute("KhachHang")!=null){
    kh = (KhachHang_pojo)session.getAttribute("KhachHang");
    tenkhachhang=kh.getTenKhachhang();
    username=kh.getTenDangNhap();
    diachi = kh.getDiaChi();
    sodienthoai=kh.getSoDienThoai();
    email = kh.getEmail();
}

String masanpham = request.getParameter("masanpham");
SanPham_pojo sp = SanPham_dao.LaySanPhamTheoMa(masanpham);
String chitiet = sp.getChiTietSanPham();
String [] ct = chitiet.split(";");
%>
<form id="form1" name="form1" method="get" action="dondathang_controller">

    <table width="100%" border="0">
  <tr>
    <td align="center" valign="top"><strong><font color="red"><h3><%=sp.getTenSanPham() %></h3></font></strong></td>
  </tr>
  <tr>
    <td height="327" align="center" valign="top"><img src="<%=sp.getImage()  %>" width="50%" height="100%" /></td>
  </tr>
  <tr>
    <td align="center" valign="top">GIÁ : <font color="red"><%=sp.getGia() %> <strong>K</strong></font></td>
  </tr>
  <tr>
    <td align="center" valign="top">KICH THƯỚC:<%=sp.getKichThuoc() %></td>
  </tr>
  <tr>
    <td align="center" valign="top"><p>CHI TIẾT SẢN PHẨM:</p>
        
      <ul>
         <%for(int i =0 ;i< ct.length;i++){ %>
        <li><%=ct[i] %></li><%}%>        
    </ul></td>
  </tr>
  
</table>
    
   
    


<table width="50%" border="0">
  <tr>
    <td colspan="2" align="left"><strong><font color="green">THÔNG TIN KHÁCH HÀNG</font></strong></td>
  </tr>
  <tr>
    <td width="30%">Họ tên:</td>
    <td width="70%"><input type="text" name="txthoten" id="txthoten" value="<%=tenkhachhang %>" /></td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><input type="text" name="txtemail" id="txtemail" value="<%=email %>" /></td>
  </tr>
  <tr>
    <td>Địa chỉ:</td>
    <td><input type="text" name="txtdiachi" id="txtdiachi" value="<%=diachi %>" /></td>
  </tr>
  <tr>
    <td>Số điện thoại:</td>
    <td><input type="text" name="txtsodienthoai" id="txtsodienthoai" value="<%=sodienthoai %>" /></td>
  </tr>
  <tr>
    <td colspan="2">
        <input type="hidden" name="masanpham" value=<%=masanpham%>>
        <input type="hidden" name ="action" value="mua">
        <input type="submit" name="btmua" id="btmua" value="Tôi đồng ý mua sản phẩm này" onclick="return kiemtrathongtin();"/>
    </td>
    </tr>
</table>


</form>